﻿package  {
	import com.guavestudios.fcfg.Fcfg;
	import com.guavestudios.fcfg.readers.FcfgDefaultReader;
	import com.guavestudios.fcfg.readers.FcfgXmlReader;
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.text.TextField;
	/**
	 * ...
	 * @author maze | guavestudios.com
	 */
	public class FcfgMain extends Sprite{
		
		
		public function FcfgMain() {
			
			var cfg:Fcfg = new Fcfg();
			
			var def:FcfgDefaultReader = new FcfgDefaultReader();
			cfg.addReader(def);
			def.idMap = { "main.config1":"config1"};
			def.load( { config:true, config1:false },stage.loaderInfo.parameters );
			
			
			var xml:FcfgXmlReader = new FcfgXmlReader(//);
			//xml.load(
				<root>
					<setting id="config2">lalalal</setting>
					<setting id="config3" type="boolean">true</setting>
					<setting id="config4" type="int">123.7</setting>
				</root>
			);
			cfg.addReader(xml);
			
			trace("(FcfgMain.FcfgMain) " + cfg.getSetting("config"));
			
			cfg.setSetting("config", false);
			
			trace("(FcfgMain.FcfgMain) " + cfg.getSetting("config"));
			
			cfg.removeSetting("config");
			
			trace("(FcfgMain.FcfgMain) " + cfg.getSetting("config"));
			
			trace("(FcfgMain.FcfgMain) " + cfg.toString());
			
			
		}
		
	}

}